using System;
using System.Collections.Generic;
using System.Text;

namespace CodePlex.SpaceBlock.JobModel
{
    public abstract class BaseJob
    {
        private readonly IFileSystem _target;


        private string _caption;
        private string _description;
        private int _progress;

        private Path _targetPath;


        protected BaseJob(IFileSystem target)
        {
            _target = target;
        }


        virtual public IFileSystem GetTargetFS()
        {
            return _target;
        }

        virtual public Path GetTargetPath()
        {
            return _targetPath;
        }

        virtual public string GetCaption()
        {
            return _caption;
        }

        virtual public string GetDescription()
        {
            return _description;
        }

        virtual public int GetProgress()
        {
            return _progress;
        }









        protected IFileSystem TargetFS
        {
            get
            {
                return _target;
            }
        }

      
        protected void UpdateDescription(string message, params object[] parameters)
        {
            _description = string.Format(message, parameters);
        }


        protected void UpdateCaption(string message, params object[] parameters)
        {
            _caption = string.Format(message, parameters);
        }

        protected void UpdateProgress(int value)
        {
            _progress = value;
        }

        protected void UpdateProgress(int i, int n)
        {
            UpdateProgress((int)(100D * (double)i / (double)n));
        }

        protected void UpdateTargetPath(Path path)
        {
            _targetPath = path;
        }


   


       

    }
}
